//
//  SettingCardCell.m
//  SinaWebo
//
//  Created by wwj on 16/6/20.
//  Copyright © 2016年 亦心. All rights reserved.
//

#import "SettingCardCell.h"
#import "CardGroup.h"
#import "NSString+Extension.h"
#import <UIImageView+WebCache.h>

@interface SettingCardCell ()
@property (weak, nonatomic) IBOutlet UIImageView *img;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *subTitle;
@property (weak, nonatomic) IBOutlet UIButton *bageBtn;
@property (weak, nonatomic) IBOutlet UIImageView *arrow;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleWith;
@end
@implementation SettingCardCell

- (void)setModel:(CardGroup *)model{
    _model = model;
    [_img sd_setImageWithURL:[NSURL URLWithString:model.pic] completed:nil];
    NSString *desc = model.desc?model.desc:model.desc1;
    
    _title.text = desc?desc: model.title;
    _subTitle.text = model.desc_extr;
    
    _titleWith.constant = [_title.text sizeWithFont:_title.font].width;
}
@end
